package com.mxw.rulesengine.mapper.domain;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

@Data
public class TtFactoringRiskParam implements Serializable {
  private BigDecimal applyFactoringAmount;

  private BigDecimal maxLimit;

  private BigDecimal availableLimit;

  private BigDecimal usedLimit;

  private BigDecimal storeEligibleWithdrawableAmount;

  private BigDecimal totalWithdrawableAmount;

  private List<InnerOrderInfo> orderInfoList;

  private String allowChargebackResult;

  private String allowChargebackReason;

  private String chargebackRate30DaysResult;

  private String chargebackRate30DaysReason;

  private String amountFinancedResult;

  private String amountFinancedReason;

  public TtFactoringRiskParam() {}

  public TtFactoringRiskParam(
      BigDecimal applyFactoringAmount,
      BigDecimal maxLimit,
      BigDecimal availableLimit,
      BigDecimal usedLimit,
      BigDecimal storeEligibleWithdrawableAmount,
      BigDecimal totalWithdrawableAmount,
      List<InnerOrderInfo> orderInfoList) {
    this.applyFactoringAmount = applyFactoringAmount;
    this.maxLimit = maxLimit;
    this.availableLimit = availableLimit;
    this.usedLimit = usedLimit;
    this.storeEligibleWithdrawableAmount = storeEligibleWithdrawableAmount;
    this.totalWithdrawableAmount = totalWithdrawableAmount;
    this.orderInfoList = orderInfoList;
  }

  @Data
  @Builder
  @NoArgsConstructor
  @AllArgsConstructor
  public static class InnerOrderInfo implements Serializable {
    private String storeId;

    private String orderNo;

    private BigDecimal orderAmount;

    private BigDecimal refusePayRate30Day;

    private Boolean refusePayRisk;
  }
}
